import {Map} from 'immutable'
import * as actionTypes from './constants'
const defaultState = Map({
  cateList: [],
  currentId: 3,
  newGoodDjradio: [],
  djradioRank: [],
  djradioCount: 0,
  djradioPrograms: [],
  djradioDetail:{}
})
export default function reducer(state = defaultState, action) {
  switch (action.type) {
    case actionTypes.CHANGE_DJRADIO_CATELIST_ACTION:
      return state.set('cateList', action.cateList)
    case actionTypes.CHANGE_CURRENT_ID_ACTION:
      return state.set('currentId', action.currentId)
    case actionTypes.CHANGE_NEW_GOOD_DJRADIO_ACTION:
      return state.set('newGoodDjradio', action.newGoodDjradio)
    case actionTypes.CHANGE_DJRADIO_RANK_ACTION:
      return state.set('djradioRank', action.djradioRank)
    case actionTypes.CHANGE_DJRADIO_COUNT_ACTION:
      return state.set('djradioCount', action.djradioCount)
    case actionTypes.CHANGE_DJRADIO_PROGRAMS_ACTION:
      return state.set('djradioPrograms', action.djradioPrograms)
    case actionTypes.CHANGE_DJRADIO_DETAIL_ACTION:
      return state.set('djradioDetail',action.djradioDetail)
    default:
      return state
  }
}